﻿namespace SPRepository
{
    public class DocumentContentTypeDto : ItemContentTypeDto, IDocumentContentTypeDto
    {
        private string _fileName;
        public DocumentContentTypeDto() { }

        public DocumentContentTypeDto(DocumentContentTypeDto dto)
            : this(dto.DocumentCreatedBy, dto.DocumentModifiedBy, dto.FileName, dto)
        {
        }

        public DocumentContentTypeDto(string documentCreatedBy, string documentModifiedBy, string fileName, ItemContentTypeDto baseDto) : base(baseDto)
        {
            DocumentModifiedBy = documentModifiedBy;
            DocumentCreatedBy = documentCreatedBy;
            FileName = fileName;
        }

        public DocumentContentTypeDto(string fileName, ItemContentTypeDto baseDto)
            : this(string.Empty, string.Empty, fileName, baseDto)
        {
        }

        public string DocumentModifiedBy { get; set; }
        public string DocumentCreatedBy { get; set; }
        public string FileName
        {
            get { return _fileName; }
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    return;
                }
                _fileName = value;
            }
        }
    }
}